package org.akomantoso.core.data.type;

/**
 * This is the list of allowed values for the type attribute of the opinion element.
 * 
 * <pre>
 * <xsd:simpleType name="opinionType">
 * 		<xsd:restriction base="xsd:string">
 * 			<xsd:enumeration value="dissenting"/>
 * 			<xsd:enumeration value="agreeing"/>
 * 			<xsd:enumeration value="null"/>
 * 		</xsd:restriction>
 * </xsd:simpleType>
 * </pre>
 * 
 * @author <a href="mailto:jacques.militello@gmail.com">Jacques Militello</a>
 * 
 * @since http://www.akomantoso.org/1.0
 */
public enum OpinionType {

	dissenting("dissenting"), agreeing("agreeing"), _null("null");
	
	private String _value;
	
	private OpinionType(String value) {
		_value = value;
	}

	/**
	 * @see java.lang.Enum#toString()
	 */
	@Override
	public String toString() {
		return _value;
	}
	
	public static OpinionType checkValueOf(String name) {
		if (name == null) {
			return null;	
		}
		return valueOf(name);
	}
}